package model

import (
	"gorm.io/gorm"
	"time"
)

type Give struct {
	Id        uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	UserId    uint           `gorm:"column:user_id;type:bigint(20) UNSIGNED;comment:用户id;not null;default:0;" json:"user_id"`             // 用户id
	VideoId   uint           `gorm:"column:video_id;type:bigint(20) UNSIGNED;comment:视频id;not null;default:0;" json:"video_id"`           // 视频id
	Give      uint           `gorm:"column:give;type:int(10) UNSIGNED;comment:点赞数量;not null;default:0;" json:"give"`                      // 点赞数量
	Status    uint           `gorm:"column:status;type:bigint(20) UNSIGNED;comment:状态: 1:实现点赞 2: 取消点赞;not null;default:0;" json:"status"` // 状态: 1:实现点赞 2: 取消点赞
	CreatedAt time.Time      `gorm:"column:created_at;type:datetime(3);not null;" json:"created_at"`
	UpdatedAt time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (g *Give) TableName() string {
	return "give"
}
